package com.zhangbo.study.designpatternlearning.template;

/**
 * 模板方法：将算法进行统一封装，父类中实现相同的业务逻辑，将业务的差异点在子类中进行实现
 */
public class TemplateMethodRun {

    public static void main(String[] args) {
        System.out.println("制作一杯茶");
        CaffeineBeverage tea = new Tea();
        tea.prepareRecipe();

        System.out.println("制作一杯咖啡：");
        CaffeineBeverage coffee = new Coffee();
        coffee.prepareRecipe();

        System.out.println("制作一杯不加柠檬的热茶：");
        CaffeineBeverage hotTee = new HotTea();
        hotTee.prepareRecipe();
    }

}
